package controller;

import GUI.monitor;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class controller {
	
	public static ArrayList<String[]> loadValues() throws IOException{
			
			FileInputStream fis = new FileInputStream("values.csv");
			@SuppressWarnings("resource")
			BufferedReader reader = new BufferedReader(new InputStreamReader(fis, "UTF-8"));
			String data="";
			String[] dataItems = null;
			ArrayList<String[]> values = new ArrayList<String[]>();

			data = reader.readLine();
			while(data != null){
				data = reader.readLine();
				if(data != null){
					dataItems = data.split(";");
					values.add(dataItems);
				}
			}
			
			
			
			return values;
	}
	
	public static void main (String [] arg){
		try {
			ArrayList<String[]> sets = loadValues();
			monitor window = new monitor(sets);
			window.setVisible(true);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
